package com.cc.Serjava;

import com.cc.entity.EbProduct;
import com.cc.mapper.ProduMapper;
import com.cc.service.IEbProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class EbProductServiceImpl implements IEbProductService {
    @Autowired
    private ProduMapper produMapper;

    @Override
    public List<EbProduct> findByPage(Integer page, Integer pageSize){
        int from=(page-1)*pageSize;
        return produMapper.findByPage(from,pageSize);
    }

    @Override
    public int total() {
        return produMapper.total();
    }

    @Override
    public int delete(int id){
        return produMapper.delete(id);
    }

    @Override
    public List<EbProduct> selectAll() {
        return produMapper.selectAll();
    }

    @Override
    public EbProduct selectByCondition(int epid){
        return produMapper.selectByCondition(epid);
  }
  @Override
    public int updateById(EbProduct ebProduct){
        return produMapper.updateByPrimaryKey(ebProduct);
  }

    @Override
    public int save(EbProduct ebProduct) {
        return produMapper.save(ebProduct);
    }

    @Override
    public EbProduct detail(int epid) {
        return produMapper.detail(epid);
    }
}
